function  cAjaxForm(){
	this.container="formContainer";
};
	cAjaxForm.prototype.getDomContainer = function (){
		return document.getElementById(this.container);
	}
	cAjaxForm.prototype.show = function(content){
		this.getDomContainer().innerHTML=content;

	    document.getElementById(this.container).style.display = "block";

	}
	cAjaxForm.prototype.hide = function() {
	    document.getElementById(this.container).style.display = "none";

	}
function cModalForm(){
this.container='modalForm';
this.modalbodycontainer="modalBody";
this.modalBody =document.getElementById('modalBody');


};

cModalForm.prototype.getDomContainer = function (){
		return document.getElementById(this.container);
	}

cModalForm.prototype.show=function(content){
   // be shure body {scroll:auto} in css
    this.modalBody.innerHTML=content;
    window.onscroll = function () {scroll(0,0); 
	
	 //document.getElementById(this.container).style.top = document.body.scrollTop;
	//window.scroll(0,document.body.scrollTop);
	 };
scroll(0,0); 
	document.body.style.overflow='hidden';
	  

    document.getElementById(this.container).style.display = "block";
    document.getElementById(this.container).style.top = document.body.scrollTop;
    //window.onscroll=function (){;}
}
cModalForm.prototype.hide=function(){
        document.getElementById(this.container).style.display = "none";
	window.onscroll=function (){}
	document.body.style.overflow='auto';


}

cModalForm.prototype.init=function(){
        document.getElementById(this.container).innerHTML = "";
	
}


var oAjaxForm = new cAjaxForm();
var oModalForm = new cModalForm();

function update_form_prototype(FormObj,responseText){
FormObj.show(responseText);

var jscode='';

var re = /<script\b[\s\S]*?>([\s\S]*?)<\//ig;
var match;
while (match = re.exec(responseText)) {
	jscode=jscode+match[1];
}


/*
	var scriptTags = FormObj.getDomContainer().getElementsByTagName('script');	
  for(var no=0;no<scriptTags.length;no++){
	alert(scriptTags[no].text);
	
	var jscode = jscode+ scriptTags[no].text;
  //window.onload = function (){eval(jscode);}
eval(jscode);

 }
*/

//eval (jscode);
setTimeout(jscode,100);





}
    
